-
-
Notifications
You must be signed in to change notification settings - Fork 727
feat(linter): expose type errors via tsgolint #15917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
b465dae to
31065ed
Compare
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging #15917 will not alter performanceComparing Summary
Footnotes
|
3fc93d5 to
d29da4c
Compare
31065ed to
0682abe
Compare
0682abe to
fba7c08
Compare
d29da4c to
2666cdd
Compare
fba7c08 to
91aed72
Compare
05650c0 to
bacd607
Compare
91aed72 to
7436957
Compare
ea41ae8 to
923c900
Compare
923c900 to
a0a0c04
Compare
bacd607 to
4b9d8d2
Compare
a0a0c04 to
ee6a528
Compare
ee6a528 to
137e700
Compare
96dd1b0 to
87d27dd
Compare
87d27dd to
a33bb37
Compare
Merge activity
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new --type-check CLI flag to expose TypeScript compiler syntactic and semantic diagnostics via the tsgolint integration. This allows users to catch TypeScript type errors alongside linting issues when using type-aware linting.
- Adds
experimental_type_checkfield throughout the linting pipeline (TsGoLintState, LintRunnerBuilder) - Exposes new
report_syntacticandreport_semanticfields in the tsgolint JSON payload to control TypeScript compiler diagnostics - Updates CLI help documentation snapshots to reflect the new flag
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tasks/website/src/linter/snapshots/cli_terminal.snap | Updates terminal help text to include --type-check flag documentation |
| tasks/website/src/linter/snapshots/cli.snap | Updates markdown help text to include --type-check flag documentation |
| crates/oxc_linter/src/tsgolint.rs | Adds experimental_type_check field to TsGoLintState and exposes report_syntactic/report_semantic in JSON payload |
| crates/oxc_linter/src/lint_runner.rs | Adds experimental_type_check to LintRunnerBuilder and propagates it to TsGoLintState |
| apps/oxlint/src/lint.rs | Integrates the new flag by calling with_experimental_type_check() on LintRunnerBuilder and adds test case |
| apps/oxlint/src/command/lint.rs | Defines the --type-check CLI switch and adds unit test for the option |
| apps/oxlint/fixtures/tsgolint_type_error/tsconfig.json | Test fixture TypeScript configuration |
| apps/oxlint/fixtures/tsgolint_type_error/index.ts | Test fixture with intentional type error (string assigned to number) |
| apps/oxlint/fixtures/tsgolint_type_error/index.js | Test fixture JavaScript output |
| apps/oxlint/fixtures/tsgolint_type_error/.oxlintrc.json | Test fixture linter configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #[bpaf(switch, hide_usage)] | ||
| pub type_aware: bool, | ||
|
|
||
| /// Enable experimental type checking (includes TypeScript compiler diagnostics) |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for --type-check should mention that it requires --type-aware to be enabled. Currently, if a user passes --type-check without --type-aware, the flag is silently ignored because TsGoLintState is only created when type_aware_enabled is true (see lint_runner.rs lines 176-191).
Consider updating the description to: "Enable experimental type checking (includes TypeScript compiler diagnostics). Requires --type-aware"
| /// Enable experimental type checking (includes TypeScript compiler diagnostics) | |
| /// Enable experimental type checking (includes TypeScript compiler diagnostics). Requires --type-aware |

No description provided.